﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EasyStep.Data.Entities;
using NHibernate.Criterion;
using EasyStep.Business.Interfaces.Providers;

namespace EasyStep.Business.Providers
{
    public class TestInfoProvider : DataProviderBase<TestInfo>, ITestInfoProvider
    {
       public IEnumerable<TestInfo> GetProjectTests(Guid projectId)
        {
            using (var sm = CreateSessionManager(true))
            {
                return sm.Session.CreateCriteria<TestInfo>()
                    .Add(Expression.Eq("ProjectId", projectId))
                    .List<TestInfo>();
            }
        }
    }
}